<!DOCTYPE html>
<html>
  <head>
    <title>${webArticleType.name}</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	  <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
	  <link rel="stylesheet" href="${s.base}/mobile/css/component.css">
	  <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
	  <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css">
  </head>
  <body>
  <div class="xyg-index">
      
   <!--内容开始-->
  <div class="xyg-content">
  </div>
  <!--内容结束-->
  </div>
  
  
  </body>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  <script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
  <script src="${s.base}/mobile/js/jquery-weui.js"></script>
  <script src="${s.base}/mobile/js/dateUtil.js"></script>
  <script src="${s.base}/mobile/fonts/iconfont.js"></script>
  <script>
      var memberId='${memberId}';
      var id='${webArticleType.id}';
      var pageNum=0;
      var loading = false;  //状态标记
      var pageSize=10;
      $(document).ready(function(e) {
          sendPost();
          $(document.body).infinite();
          $(document.body).infinite().on("infinite", function() {
              if(loading) return;
              loading = true;
              sendPost();
          });
      });
      function sendPost() {
          pageNum++;
          $.post("/phone/articlePage",{
              pageNum : pageNum,
              pageSize : pageSize,
              typeId : id
          },function(resultInfo){
              if (resultInfo.code == 0){
                  if (resultInfo.data!=null && resultInfo.data.length > 0){
                      for(var i=0;i<resultInfo.data.length;i++){
                          var obj = resultInfo.data[i];
                          var content=
							  '<div class="xyg-content-item"><a href="/phone/article?id='+obj.id+'&memberId='+memberId+'">'+
							  	  '<div class="xyg-content-item-pic">'+
							  		'<img src="'+ obj.picture+'"/>'+
							  	  '</div>'+
								  '<div class="xyg-content-item-content">'+
									  '<div class="xyg-content-item-content-tip font1 padding-t1">'+ obj.title+
									  ' </div>'+
									  '<div class="xyg-content-item-content-tip font3 padding-tb1">'+ obj.description+
						  				' </div>'+
									  '<div class="xyg-content-item-content-tip font2 text-right">'+
									  'Date:&nbsp;'+$.fn.formatDate(new Date(obj.createTime), "yyyy-MM-dd hh:mm:ss")+
									  '</div>'+
								  '</div>'+
                              '</a></div>';
                          $(".xyg-content").append(content);
                          loading = false;
                          if(!resultInfo.hasNextPage){
                              $(document.body).destroyInfinite();
                          }
                      }
                  }
              }
          },"json");
      }


  </script>
</html>

